Universal serial bus (USB) is an interface configured to connect one or more peripheral devices (e.g., cameras, scanners, etc.) to a computer. With USB, the computer may send or retrieve data to and from the one or more peripheral devices. A physical USB peripheral controller is disposed between the computer and the one or more peripheral devices and is configured to transfer data between the computer and the one or more peripheral devices. In addition, the physical USB peripheral controller may emulate various USB data transfer scenarios. For example, the physical USB peripheral controller may be configured to emulate a USB peripheral scanner to receive USB requests and respond to the computer. Thus, to test the data transfer of a set of USB peripheral devices, instead of actually obtaining the USB peripheral devices, the physical USB peripheral controller may be configured to emulate these USB peripheral devices.
FIG. 1 illustrates convention physical USB peripheral controller 110 in virtualized computing environment 100. Virtualized computing environment 100 may include one or more physical servers 120, each of which includes a suitable physical hardware 130 and virtualization software 140 (e.g., hypervisor) to support multiple virtual machines 152, 154, and 156. Virtualization software 140 generally maintains a mapping between resources allocated to virtual machines 152, 154, and 156, and physical hardware 130 provided by physical servers 120.
Physical USB peripheral controller 110 may be attached to USB port 132 of physical hardware 130. Virtualization software 140 includes USB driver 142, which communicates with physical USB peripheral controller 110 via USB port 132. Virtualization software 140 further includes USB arbitrator 144, which is configured to manage connections between physical USB peripheral controller 110 and virtual machines 152, 154, and 156 that reside on physical server 120. Suppose virtual machine 152 is powered on. In such a scenario, USB arbitrator 144 is configured to connect physical USB peripheral controller 110 to virtual machine 152 and direct data traffic between physical USB peripheral controller 110 and virtual machine 152. When physical USB peripheral controller 110 is connected to virtual machine 152, USB arbitrator 144 is also configured to prevent other virtual machines (e.g., virtual machines 154 and 156) from accessing physical USB peripheral controller 110.
However, the arrangement set forth above requires the support of USB related hardware (e.g., USB port 132) in physical server 120 and a physical attachment between physical peripheral controller 110 and physical server 120.